home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3n / getsockopt.z / getsockopt
Encoding:
Text File  |  1998-10-20  |  13.6 KB  |  198 lines

  1.  
  2.  
  3.  
  4. ggggeeeettttssssoooocccckkkkoooopppptttt((((3333NNNN))))                                                  ggggeeeettttssssoooocccckkkkoooopppptttt((((3333NNNN))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _gggg_eeee_tttt_ssss_oooo_cccc_kkkk_oooo_pppp_tttt, _ssss_eeee_tttt_ssss_oooo_cccc_kkkk_oooo_pppp_tttt - get and set options on sockets
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_tttt_yyyy_pppp_eeee_ssss_...._hhhh_>>>>
  13.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_ssss_oooo_cccc_kkkk_eeee_tttt_...._hhhh_>>>>
  14.      _iiii_nnnn_tttt _gggg_eeee_tttt_ssss_oooo_cccc_kkkk_oooo_pppp_tttt_((((_iiii_nnnn_tttt _ssss_,,,, _iiii_nnnn_tttt _llll_eeee_vvvv_eeee_llll_,,,, _iiii_nnnn_tttt _oooo_pppp_tttt_nnnn_aaaa_mmmm_eeee_,,,, _cccc_hhhh_aaaa_rrrr _****_oooo_pppp_tttt_vvvv_aaaa_llll_,,,,
  15.          _iiii_nnnn_tttt _****_oooo_pppp_tttt_llll_eeee_nnnn_))))_;;;;
  16.      _iiii_nnnn_tttt _ssss_eeee_tttt_ssss_oooo_cccc_kkkk_oooo_pppp_tttt_((((_iiii_nnnn_tttt _ssss_,,,, _iiii_nnnn_tttt _llll_eeee_vvvv_eeee_llll_,,,, _iiii_nnnn_tttt _oooo_pppp_tttt_nnnn_aaaa_mmmm_eeee_,,,, _cccc_hhhh_aaaa_rrrr _****_oooo_pppp_tttt_vvvv_aaaa_llll_,,,,
  17.          _iiii_nnnn_tttt _oooo_pppp_tttt_llll_eeee_nnnn_))))_;;;;
  18.  
  19. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  20.      _gggg_eeee_tttt_ssss_oooo_cccc_kkkk_oooo_pppp_tttt and _ssss_eeee_tttt_ssss_oooo_cccc_kkkk_oooo_pppp_tttt manipulate _o_p_t_i_o_n_s associated with a socket.
  21.      Options may exist at multiple protocol levels; they are always present at
  22.      the uppermost socket level.
  23.  
  24.      When manipulating socket options, the level at which the option resides
  25.      and the name of the option must be specified.  To manipulate options at
  26.      the socket level, _l_e_v_e_l is specified as _SSSS_OOOO_LLLL______SSSS_OOOO_CCCC_KKKK_EEEE_TTTT.  To manipulate
  27.      options at any other level, _l_e_v_e_l is the protocol number of the protocol
  28.      that controls the option.  For example, to indicate that an option is to
  29.      be interpreted by the TCP protocol, _l_e_v_e_l is set to the TCP protocol
  30.      number [see _gggg_eeee_tttt_pppp_rrrr_oooo_tttt_oooo_eeee_nnnn_tttt(3N)].
  31.  
  32.      The parameters _o_p_t_v_a_l and _o_p_t_l_e_n are used to access option values for
  33.      _ssss_eeee_tttt_ssss_oooo_cccc_kkkk_oooo_pppp_tttt.  For _gggg_eeee_tttt_ssss_oooo_cccc_kkkk_oooo_pppp_tttt, they identify a buffer in which the value(s)
  34.      for the requested option(s) are to be returned.  For _gggg_eeee_tttt_ssss_oooo_cccc_kkkk_oooo_pppp_tttt, _o_p_t_l_e_n
  35.      is a value-result parameter, initially containing the size of the buffer
  36.      pointed to by _o_p_t_v_a_l, and modified on return to indicate the actual size
  37.      of the value returned.  If no option value is to be supplied or returned,
  38.      a 0 _o_p_t_v_a_l may be supplied.
  39.  
  40.      _o_p_t_n_a_m_e and any specified options are passed uninterpreted to the
  41.      appropriate protocol module for interpretation.  The include file
  42.      _ssss_yyyy_ssss_////_ssss_oooo_cccc_kkkk_eeee_tttt_...._hhhh contains definitions for the socket-level options described
  43.      below.  Options at other protocol levels vary in format and name.
  44.  
  45.      Most socket-level options take an _iiii_nnnn_tttt for _o_p_t_v_a_l.  For _ssss_eeee_tttt_ssss_oooo_cccc_kkkk_oooo_pppp_tttt, the
  46.      _o_p_t_v_a_l parameter should be non-zero to enable a boolean option, or zero
  47.      if the option is to be disabled.  _SSSS_OOOO______LLLL_IIII_NNNN_GGGG_EEEE_RRRR uses a _ssss_tttt_rrrr_uuuu_cccc_tttt _llll_iiii_nnnn_gggg_eeee_rrrr
  48.      parameter that specifies the desired state of the option and the linger
  49.      interval (see below).  _ssss_tttt_rrrr_uuuu_cccc_tttt _llll_iiii_nnnn_gggg_eeee_rrrr is defined in
  50.      _////_uuuu_ssss_rrrr_////_iiii_nnnn_cccc_llll_uuuu_dddd_eeee_////_ssss_yyyy_ssss_////_ssss_oooo_cccc_kkkk_eeee_tttt_...._hhhh.
  51.  
  52.      The following options are recognized at the socket level.  Except as
  53.      noted, each may be examined with _gggg_eeee_tttt_ssss_oooo_cccc_kkkk_oooo_pppp_tttt and set with _ssss_eeee_tttt_ssss_oooo_cccc_kkkk_oooo_pppp_tttt.
  54.  
  55.           _SSSS_OOOO______DDDD_EEEE_BBBB_UUUU_GGGG            toggle recording of debugging information
  56.           _SSSS_OOOO______RRRR_EEEE_UUUU_SSSS_EEEE_AAAA_DDDD_DDDD_RRRR        toggle local address reuse
  57.  
  58.  
  59.  
  60.  
  61.  
  62.                                                                         PPPPaaaaggggeeee 1111
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69. ggggeeeettttssssoooocccckkkkoooopppptttt((((3333NNNN))))                                                  ggggeeeettttssssoooocccckkkkoooopppptttt((((3333NNNN))))
  70.  
  71.  
  72.  
  73.           _SSSS_OOOO______KKKK_EEEE_EEEE_PPPP_AAAA_LLLL_IIII_VVVV_EEEE        toggle keep connections alive
  74.           _SSSS_OOOO______DDDD_OOOO_NNNN_TTTT_RRRR_OOOO_UUUU_TTTT_EEEE        toggle routing bypass for outgoing messages
  75.           _SSSS_OOOO______LLLL_IIII_NNNN_GGGG_EEEE_RRRR           linger on close if data is present
  76.           _SSSS_OOOO______BBBB_RRRR_OOOO_AAAA_DDDD_CCCC_AAAA_SSSS_TTTT        toggle permission to transmit broadcast messages
  77.           _SSSS_OOOO______OOOO_OOOO_BBBB_IIII_NNNN_LLLL_IIII_NNNN_EEEE        toggle reception of out-of-band data in band
  78.           _SSSS_OOOO______SSSS_NNNN_DDDD_BBBB_UUUU_FFFF           set buffer size for output
  79.           _SSSS_OOOO______RRRR_CCCC_VVVV_BBBB_UUUU_FFFF           set buffer size for input
  80.           _SSSS_OOOO______TTTT_YYYY_PPPP_EEEE             get the type of the socket (get only)
  81.           _SSSS_OOOO______EEEE_RRRR_RRRR_OOOO_RRRR            get and clear error on the socket (get only)
  82.  
  83.      _SSSS_OOOO______DDDD_EEEE_BBBB_UUUU_GGGG enables debugging in the underlying protocol modules.
  84.      _SSSS_OOOO______RRRR_EEEE_UUUU_SSSS_EEEE_AAAA_DDDD_DDDD_RRRR indicates that the rules used in validating addresses
  85.      supplied in a _bbbb_iiii_nnnn_dddd call should allow reuse of local addresses.
  86.      _SSSS_OOOO______KKKK_EEEE_EEEE_PPPP_AAAA_LLLL_IIII_VVVV_EEEE enables the periodic transmission of messages on a connected
  87.      socket.  If the connected party fails to respond to these messages, the
  88.      connection is considered broken and processes using the socket are
  89.      notified using a _SSSS_IIII_GGGG_PPPP_IIII_PPPP_EEEE signal.  _SSSS_OOOO______DDDD_OOOO_NNNN_TTTT_RRRR_OOOO_UUUU_TTTT_EEEE indicates that outgoing
  90.      messages should bypass the standard routing facilities.  Instead,
  91.      messages are directed to the appropriate network interface according to
  92.      the network portion of the destination address.
  93.  
  94.      _SSSS_OOOO______LLLL_IIII_NNNN_GGGG_EEEE_RRRR controls the action taken when unsent messages are queued on a
  95.      socket and a _cccc_llll_oooo_ssss_eeee is performed.  If the socket promises reliable
  96.      delivery of data and _SSSS_OOOO______LLLL_IIII_NNNN_GGGG_EEEE_RRRR is set, the system will block the process
  97.      on the _cccc_llll_oooo_ssss_eeee attempt until it is able to transmit the data or until it
  98.      decides it is unable to deliver the information (a timeout period, termed
  99.      the linger interval, is specified in the _ssss_eeee_tttt_ssss_oooo_cccc_kkkk_oooo_pppp_tttt call when _SSSS_OOOO______LLLL_IIII_NNNN_GGGG_EEEE_RRRR
  100.      is requested).  If _SSSS_OOOO______LLLL_IIII_NNNN_GGGG_EEEE_RRRR is disabled and a _cccc_llll_oooo_ssss_eeee is issued, the
  101.      system will process the _cccc_llll_oooo_ssss_eeee() in a manner that allows the process to
  102.      continue as quickly as possible.
  103.  
  104.      The option _SSSS_OOOO______BBBB_RRRR_OOOO_AAAA_DDDD_CCCC_AAAA_SSSS_TTTT requests permission to send broadcast datagrams
  105.      on the socket.  With protocols that support out-of-band data, the
  106.      _SSSS_OOOO______OOOO_OOOO_BBBB_IIII_NNNN_LLLL_IIII_NNNN_EEEE option requests that out-of-band data be placed in the
  107.      normal data input queue as received; it will then be accessible with _rrrr_eeee_cccc_vvvv
  108.      or _rrrr_eeee_aaaa_dddd calls without the _MMMM_SSSS_GGGG______OOOO_OOOO_BBBB flag.  _SSSS_OOOO______SSSS_NNNN_DDDD_BBBB_UUUU_FFFF and _SSSS_OOOO______RRRR_CCCC_VVVV_BBBB_UUUU_FFFF are
  109.      options that adjust the normal buffer sizes allocated for output and
  110.      input buffers, respectively.  The buffer size may be increased for high-
  111.      volume connections or may be decreased to limit the possible backlog of
  112.      incoming data.  The system places an absolute limit on these values.
  113.      Finally, _SSSS_OOOO______TTTT_YYYY_PPPP_EEEE and _SSSS_OOOO______EEEE_RRRR_RRRR_OOOO_RRRR are options used only with _gggg_eeee_tttt_ssss_oooo_cccc_kkkk_oooo_pppp_tttt.
  114.      _SSSS_OOOO______TTTT_YYYY_PPPP_EEEE returns the type of the socket (for example, _SSSS_OOOO_CCCC_KKKK______SSSS_TTTT_RRRR_EEEE_AAAA_MMMM_)))).  It is
  115.      useful for servers that inherit sockets on startup.  _SSSS_OOOO______EEEE_RRRR_RRRR_OOOO_RRRR returns any
  116.      pending error on the socket and clears the error status.  It may be used
  117.      to check for asynchronous errors on connected datagram sockets or for
  118.      other asynchronous errors.
  119.  
  120. RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEE
  121.      A _0000 is returned if the call succeeds, _----_1111 if it fails.
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.                                                                         PPPPaaaaggggeeee 2222
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135. ggggeeeettttssssoooocccckkkkoooopppptttt((((3333NNNN))))                                                  ggggeeeettttssssoooocccckkkkoooopppptttt((((3333NNNN))))
  136.  
  137.  
  138.  
  139. EEEERRRRRRRROOOORRRRSSSS
  140.      The call succeeds unless:
  141.  
  142.      _EEEE_BBBB_AAAA_DDDD_FFFF               The argument _s is not a valid descriptor.
  143.  
  144.      _EEEE_NNNN_OOOO_TTTT_SSSS_OOOO_CCCC_KKKK            The argument _s is a file, not a socket.
  145.  
  146.      _EEEE_NNNN_OOOO_PPPP_RRRR_OOOO_TTTT_OOOO_OOOO_PPPP_TTTT         The option is unknown at the level indicated.
  147.  
  148.      _EEEE_NNNN_OOOO_MMMM_EEEE_MMMM              There was insufficient user memory available for the
  149.                          operation to complete.
  150.  
  151.      _EEEE_NNNN_OOOO_SSSS_RRRR               There were insufficient STREAMS resources available
  152.                          for the operation to complete.
  153.  
  154. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  155.      _cccc_llll_oooo_ssss_eeee(2), _iiii_oooo_cccc_tttt_llll(2), _rrrr_eeee_aaaa_dddd(2), _ssss_oooo_cccc_kkkk_eeee_tttt(3N), _gggg_eeee_tttt_pppp_rrrr_oooo_tttt_oooo_eeee_nnnn_tttt(3N)
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.                                                                         PPPPaaaaggggeeee 3333
  195.  
  196.  
  197.  
  198.